package comp

var Fc *FContext

func init() {
	Fc = &FContext{
		C: make(map[string]*FParam),
	}
}

type FContext struct {
	C map[string]*FParam
}

func (f *FContext) Put(key string, v string) {
	f.C[key] = NewFParam(key, v)
}

func (f *FContext) getParam(key string) interface{} {
	return f.C[key]
}

func (f *FContext) getStr(key string) string {
	param := f.C[key]

	return param.Value.(string)
}

func (f *FContext) getInt(key string) int {
	param := f.C[key]

	return param.Value.(int)
}

type FParam struct {
	Key   string
	Value interface{}
}

func NewFParam(key string, value interface{}) *FParam {
	return &FParam{Key: key, Value: value}
}
